package phylacterium.tools;

import javax.servlet.http.HttpServletRequest;

public class Utils {
	public static String checkRequestPage(HttpServletRequest request, String page){
		String output = new String();
		
		if (request.getRequestURL().toString().endsWith(page))
			output = "class=\"current_page_item\"";
		
		return output;
	}
	
	public static String getPageTitle(HttpServletRequest request){
		String url = request.getRequestURL().toString();
		String pageTitle = new String();
		
		if (url.endsWith("map.jsp"))
			pageTitle = "Phylacterium - your music's got soul :: Map";
		else if (url.endsWith("register.jsp"))
			pageTitle = "Phylacterium - your music's got soul :: Register";
		else if (url.endsWith("login.jsp"))
			pageTitle = "Phylacterium - your music's got soul :: Login";
		else if (url.endsWith("account.jsp"))
			pageTitle = "Phylacterium - your music's got soul :: My Account";
		else if (url.endsWith("statistics.jsp"))
			pageTitle = "Phylacterium - your music's got soul :: Statistics";
		else 
			pageTitle = "Phylacterium - your music's got soul";
		
		return pageTitle;
	}
}
